<?php
/**
 * Author: 式神(vashi)
 * email: 289650682@qq.com
 * Date: 2019/2/21 16:40
 * FileName: Ads.php
 */

namespace app\cms\controller;

use app\common\controller\Common;
use app\common\model\System;

class Setting extends Common
{
    protected $middleware = ['Auth'];

    protected function initialize()
    {
        parent::initialize();
        $this->db = new System();
    }
    public function index(){
        //$input=input('get.');
        $data = $this->db->where('name','cms')->find();
        $d=[
            "code"=>0,
        ];
        $d['data']=$data;
        return json($d);
    }

    //添加
    public function add(){
        $res=$this->db->add(input('post.'));
        return json($res);
    }
    //编辑
    public function edit(){
        $res=$this->db->edit(input('post.'));
        return json($res);
    }
    //删除
    public function del(){
        $res=$this->db->del(input('post.'));
        return json($res);
    }
}